<%@tag pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@attribute name="title" %>
<%@attribute name="pageId" %>
<%@taglib prefix="mf" uri="/WEB-INF/tld/funcs.tld"%>
<c:set var="user" value="${mf:getCurrentUser(pageContext.request)}"/>
<c:set var="currentPageId" value="${pageId}" scope="request"/>
<!DOCTYPE html>
<html>
  <head>
    <%@ include file="/WEB-INF/jsp/common/common-head.jsp"%>
    <%@ include file="/WEB-INF/jsp/pc/common/common-head.jsp"%>
    <title>${title} - フォトサルベージの輪</title>
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="Thu, 01 Dec 1994 16:00:00 GMT">
  </head>
  <body>
    <table class="layout-container">
      <tr>
        <td class="layout-header" colspan="2">
          <div class="header">
            <div class="site-header" align="right">
              <span class="user-label">${user.name}</span> |
              <span class="logout"><a href="${pageContext.request.contextPath}/users/logout">ログアウト</a></span>
            </div>
            <h1 class="site-header-title">
              <img class="logo" src="${pageContext.request.contextPath}/images/logo.png" alt="フォトサルベージ">
            </h1>
          </div>
        </td>
      </tr>
      <tr class="layout-main-container">
        <td class="layout-sidebar">
          <div class="nav">
            <h3 class="nav-title">ナビゲーション</h3>
            <ul>
              <tags:nav-menu-item label="画像を検索" pageId="/photos/list" url="/photos/list.html"/>
              <tags:nav-menu-item label="あなたがレタッチ中の画像" pageId="/photos/list/retouching_by_me" url="/photos/retouchingByMe.html"/>
              <tags:nav-menu-item label="プロフィール編集" pageId="/users/update" url="/users/update.html"/>
            </ul>
          </div>
          <c:if test="${user.administrator}">
            <div class="nav">
              <h3 class="nav-title">管理者メニュー</h3>
              <ul>
                <tags:nav-menu-item label="ユーザ作成" pageId="/users/create" url="/users/create.html"/>
                <tags:nav-menu-item label="アップロード" pageId="/photos/upload" url="/photos/upload.html"/>
              </ul>
            </div>
          </c:if>
        </td>
        <td class="layout-page-content">
          <div class="page-content">
          <%--
            <h2 class="page-title">${title}</h2>
          --%>
            <%@ include file="/WEB-INF/jsp/common/errors.jsp" %>
            <jsp:doBody/>
          </div>
        </td>
      </tr>
      <tr class="layout-footer">
        <td>
          <div class="page-footer"><small>&nbsp;</small></div>
        </td>
      </tr>
    </table>
    <%@ include file="/WEB-INF/jsp/common/common-foot.jsp"%>
    <%@ include file="/WEB-INF/jsp/pc/common/common-foot.jsp"%>
  </body>
</html>
